<div class="add-subcat">
    <form id="form1" class="layui-form layui-form-pane" action="/education/admin/area/save">
        <div class="layui-form-item">
            <label class="layui-form-label">上级</label>
            <div class="layui-input-inline">
                <input type="hidden" name="parent_id" >
                <input type="text" name="parentname" class="layui-input" readonly>
            </div>
            <a class="layui-btn" onclick="beforeChoice();">
                <i class="iconfont">&#xe649;</i> 选择
            </a>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" required jq-verify="required" jq-error="请输入名称"
                       class="layui-input ">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="number" name="ord" required jq-verify="number" jq-error="排序必须为数字"
                       class="layui-input ">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-inline">
                <select name="status">
                    <option value="">请选择</option>
                    <option value="0">停用</option>
                    <option value="1">启用</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" jq-submit jq-filter="submit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function choiceDept(item){
        var $ = layui.jquery;
        $('input[name="parent_id"]').val(item.id);
        $('input[name="parentname"]').val(item.name);
    }

    function beforeChoice(){
        var index = layer.open({
            type: 2,
            content: "area-tree.html", "title": "选择地区", "area": ['500px', '600px'], "maxmin":"true"
        });
    }

</script>